package com.treasure.mall.biz.service.core.order;

import com.treasure.mall.biz.base.SearchableCrudService;
import com.treasure.mall.biz.dto.order.BizOrderCreateDTO;
import com.treasure.mall.biz.entity.order.BizOrderPO;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/6/14
 */
public interface BizOrderService extends SearchableCrudService<BizOrderPO, String> {
    @Transactional
    BizOrderPO create(BizOrderCreateDTO createDTO);


    /**
     * 支付成功
     *
     * @param bizOrderPO
     */
    @Transactional
    void payed(BizOrderPO bizOrderPO);

    /**
     * 是否可以拍卖
     *
     * @param userId
     * @return
     */
    boolean enableAuction(Long userId, Long sessionId);

    BizOrderPO findByAuctionAndUser(Long userId, Long sessionId);

    void refund(BizOrderPO orderPO);

    void refundComplete(String orderId);
}
